package com.mingshashan.building.easy.core.common;

/**
 * PageRequest
 *
 * @author jasonxu
 */
public class PageRequest {

    private static final int DEFAULT_PAGE = 0;

    private static final int DEFAULT_SIZE = 10;

    private final int page;
    private final int size;

    public PageRequest(int page, int size) {

        if (page < 0) {
            throw new IllegalArgumentException("PageRequest index must not be less than zero!");
        }

        if (size < 1) {
            throw new IllegalArgumentException("PageRequest size must not be less than one!");
        }


        this.page = page;
        this.size = size;
    }

    public int getPage() {
        return page;
    }

    public int getSize() {
        return size;
    }
}
